package com.moto.controller.user;

import com.moto.entity.RotationH;
import com.moto.entity.RotationS;
import com.moto.result.Result;
import com.moto.service.IRotationHService;
import com.moto.service.IRotationSService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 商场轮播图 前端控制器
 * </p>
 *
 * @author hyf
 * @since 2023-09-03
 */
@RestController
@RequestMapping("/moto/rotation")
@Api(tags = "轮播图")
@CrossOrigin("*")
public class RotationSController {
    @Autowired
    private IRotationHService rotationHService;
    @Autowired
    private IRotationSService rotationSService;

    /**
     * 首页轮播图
     */
    @GetMapping("/h")
    @ApiOperation("首页轮播图")
    public Result<List<RotationH>> findR(){
        List<RotationH> list = rotationHService.findAll();
        return Result.success(list);
    }
    /**
     * 商品轮播图
     */
    @GetMapping("/s")
    @ApiOperation("商品轮播图")
    public Result<List<RotationS>> findS(){
        List<RotationS> list = rotationSService.finALL();
        return Result.success(list);
    }
}
